<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
</head>

<body>
  <script>
    /*if(条件表达式|变量|值)
    表达式|变量|值?表达式|变量|值:表达式|变量|值
    单元1?单元2:单元3*/

    const res = 1 > 2 ? 10 : 20;
    console.log(res);
  </script>
</body>

</html>